package cn.xenosp.server.config.activiti;

import org.activiti.api.runtime.shared.identity.UserGroupManager;
import org.activiti.core.common.spring.identity.ActivitiUserGroupManagerImpl;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.core.userdetails.UserDetailsService;

/**
 * 项目名： service-web
 * 包路径： cn.xenosp.server.config.activiti
 * 作者：   TongHui
 * 创建时间: 2025-03-12 14:50
 * 描述: TODO
 * 版本: 1.0
 */
@Configuration
public class ActivitiSpringIdentityAutoConfiguration {

    public ActivitiSpringIdentityAutoConfiguration() {
    }

    @Bean
    @ConditionalOnMissingBean
    public UserGroupManager userGroupManager(UserDetailsService userDetailsService) {
        return new ActivitiUserGroupManagerImpl(userDetailsService);
    }
}
